﻿@************************************************************************************//
// Autor:  		Adrian Di Puglia       							     				*//
//***********************************************************************************//
// CuotasGuest()	                												*//
// Vista que devuelve la planilla que permite editar cuota de un Usuario especificad*//
// _________________________________________________________________________________*@
@model File_Manager.Models.User_I
           
@{
    ViewBag.Title = "Manejo Cuotas";
}
<script type="text/javascript">
    disablePar(['#transactionDate', '#transactionDate02', '#transactionDate03']);
    //disableParDropList(['.disabled']);
</script>

<h2>Manejos de Cuotas</h2>

@using (Html.BeginForm())
{

/*Variable de tipoFLAG para decidir si mostrar o no el Boton de Guardado*/
var button = "NO";
    
@Html.ValidationSummary(true, "Modificación de cuotas invalida. Corregir errores y volver a intentar.")
@Html.Hidden("UserName");
 <fieldset>
        <legend>Datos del Estudiante</legend><br />
            <table width= "100%">
                <tr>
                    <td width= "50%">
                        <div class="display-label"> <b>@Html.LabelFor(m => m.name)</b></div>
                        <div class="display-field">
                            @Html.DisplayFor(model => model.name)
                        </div>
                    </td>
                    <td>
                        <div class="display-label"> <b>@Html.LabelFor(m => m.last_name)</b></div>
                        <div class="display-field">
                            @Html.DisplayFor(model => model.last_name)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width= "50%">
                        <div class="display-label"> <b>@Html.LabelFor(m => m.UserName)</b></div>
                        <div class="display-field">
                            @Html.DisplayFor(model => model.UserName)
                        </div>
                    </td>
                    <td>
                        <div class="display-label"> <b>@Html.LabelFor(m => m.idStatus)</b></div>
                        <div class="display-field">
                            @Html.DisplayFor(model => model.nStatus.name)
                        </div>
                    </td>
                </tr>
            </table>
    </fieldset>
    <fieldset>
            <legend>Datos de la Inscripción</legend><br />
                <table width= "100%">
                    <tr>
                        <td width= "50%">
                            <div class="editor-label"> <b>@Html.LabelFor(m => m.idModoPago)</b></div>
                            <div class="editor-field">
                                @Html.DisplayFor(model => model.nModoPago.name)
                            </div>
                        </td>
                        <td>
                            <div class="editor-label"> <b>@Html.LabelFor(m => m.n_cuotas_pago)</b></div>
                            <div class="editor-field">
                                @Html.DisplayFor(model => model.n_cuotas_pago) / @ViewBag.CuotasPendientes  @if (Model.idStatus == 1) { <div class="error" style="display:inline;"> * Por Revisar</div>}                                                                         
                            </div>
                        </td>
                    </tr>
            </table>
 </fieldset>
  <fieldset>
        <legend>Pago de Cuotas</legend><br />
            <table width= "100%">
                    <!--**********************************************************************************************************************************-->
                    <!--******************************************************** MANEJO DE COUTAS 01 *****************************************************-->
                    <!--**********************************************************************************************************************************-->
                    @if (Model.n_cuotas_pago == 1)
                    {
                    <tr>
                         <td width="25%">
                             <div class="editor-label">
                                @Html.LabelFor(m => m.idFormaPago)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.nFormaPago.name, new { @readonly = "readonly" })
                                @*Html.DropDownList("idFormaPago", null, new { @class = "hidden" })
                                @Html.DropDownList("idFormaPago", null, new { @class = "disabled" })<br /> *@
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.n_transaction)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(model => model.n_transaction, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.n_transaction)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.transactionDate)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.transactionDate)
                                @Html.ValidationMessageFor(m => m.transactionDate)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.verificado)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.verificado, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.verificado)
                            </div>
                        </td>
                    </tr>
                    if (Model.nModoPago.n_cuotas > 1 && Model.verificado=="SI")
                    {
                    button = "SI";
                    <tr>
                         <td colspan="2">
                             <div class="editor-label">
                                (*) @Html.LabelFor(m => m.idFormaPago02)
                            </div>
                            <div class="editor-field">
                                @Html.DropDownList("idFormaPago02")<br /> 
                            </div>
                        </td>
                         <td colspan="2">
                            <div class="editor-label">
                                (*) @Html.LabelFor(m => m.n_transaction02)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.n_transaction02, new { required = "required " })
                                @Html.ValidationMessageFor(m => m.n_transaction02)
                            </div>
                                @Html.DropDownList("idFormaPago03", null, new { @class = "hidden" })
                        </td>
                    </tr>
                    }
                    }
                    <!--**********************************************************************************************************************************-->
                    <!--******************************************************** MANEJO DE COUTAS 02 *****************************************************-->
                    <!--**********************************************************************************************************************************-->
                    @if (Model.n_cuotas_pago == 2)
                    {
                    <tr>
                         <td width="25%">
                             <div class="editor-label">
                                @Html.LabelFor(m => m.idFormaPago)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.nFormaPago.name, new { @readonly = "readonly" })
                                @*Html.DropDownList("idFormaPago", null, new { @class = "hidden" })
                                @Html.DropDownList("idFormaPago", null, new { @class = "disabled" })<br />  *@
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.n_transaction)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.n_transaction, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.n_transaction)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.transactionDate)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.transactionDate)
                                @Html.ValidationMessageFor(m => m.transactionDate)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.verificado)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.verificado, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.verificado)
                            </div>
                        </td>
                    </tr>
                    <tr>
                         <td width="25%">
                             <div class="editor-label">
                                @Html.LabelFor(m => m.idFormaPago02)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.nFormaPago02.name, new { @readonly = "readonly" })
                                @Html.DropDownList("idFormaPago02", null, new { @class = "hidden" })
                                @*Html.DropDownList("idFormaPago02", null, new { @class = "disabled" })<br />  *@
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.n_transaction02)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.n_transaction02, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.n_transaction02)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.transactionDate02)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.transactionDate02)
                                @Html.ValidationMessageFor(m => m.transactionDate02)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.verificado02)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.verificado02, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.verificado02)
                            </div>
                        </td>
                    </tr>
                    if (Model.nModoPago.n_cuotas >2 && Model.verificado02=="SI")
                    {
                    button = "SI";
                    <tr>
                         <td colspan="2">
                                <div class="editor-label">
                                (*) @Html.LabelFor(m => m.idFormaPago03)
                            </div>
                            <div class="editor-field">
                                @Html.DropDownList("idFormaPago03")<br /> 
                            </div>
                        </td>
                         <td colspan="2">
                            <div class="editor-label">
                                (*) @Html.LabelFor(m => m.n_transaction03)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.n_transaction03, new { required = "required " })
                                @Html.ValidationMessageFor(m => m.n_transaction03)
                            </div>
                        </td>
                    </tr>
                    }
                    }
                    <!--**********************************************************************************************************************************-->
                    <!--******************************************************** MANEJO DE COUTAS 03 *****************************************************-->
                    <!--**********************************************************************************************************************************-->
                    @if (Model.n_cuotas_pago == 3)
                    {
                    <tr>
                         <td width="25%">
                             <div class="editor-label">
                                @Html.LabelFor(m => m.idFormaPago)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.nFormaPago.name, new { @readonly = "readonly" })
                                @*Html.DropDownList("idFormaPago", null, new { @class = "hidden" })
                                @Html.DropDownList("idFormaPago", null, new { @class = "disabled" })<br />  *@
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.n_transaction)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.n_transaction, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.n_transaction)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.transactionDate)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.transactionDate)
                                @Html.ValidationMessageFor(m => m.transactionDate)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.verificado)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.verificado, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.verificado)
                            </div>
                        </td>
                    </tr>
                    <tr>
                         <td width="25%">
                             <div class="editor-label">
                                @Html.LabelFor(m => m.idFormaPago02)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.nFormaPago02.name, new { @readonly = "readonly" })
                                @Html.DropDownList("idFormaPago02", null, new { @class = "hidden" })
                                @*Html.DropDownList("idFormaPago02", null, new { @class = "disabled" })<br /> *@ 
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.n_transaction02)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.n_transaction02, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.n_transaction02)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.transactionDate02)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.transactionDate02)
                                @Html.ValidationMessageFor(m => m.transactionDate02)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.verificado02)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.verificado02, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.verificado02)
                            </div>
                        </td>
                    </tr>
                    <tr>
                         <td width="25%">
                             <div class="editor-label">
                                @Html.LabelFor(m => m.idFormaPago03)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.nFormaPago03.name, new { @readonly = "readonly" })
                                @Html.DropDownList("idFormaPago03", null, new { @class = "hidden" })
                                @*Html.DropDownList("idFormaPago03", null, new { @class = "disabled" })<br />  *@
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.n_transaction03)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.n_transaction03, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.n_transaction03)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.transactionDate03)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.transactionDate03)
                                @Html.ValidationMessageFor(m => m.transactionDate03)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.verificado03)
                            </div>
                            <div class="editor-field">
                                @Html.TextBoxFor(m => m.verificado03, new { @readonly = "readonly" })
                                @Html.ValidationMessageFor(m => m.verificado03)
                            </div>
                        </td>
                    </tr>
                    }
                </table>
        </fieldset>
        if (Model.n_cuotas_pago < Model.nModoPago.n_cuotas && button=="SI")
        {
        <p>
            <input type="submit" value="Salvar" />
        </p>
        }

}

<div>
    @Html.ActionLink("Menú Anterior", "../Home/Index")
</div>
